home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-05-01 | 9.3 KB | 298 lines | [ TEXT/MPS ]
{ File: DriverFamilyMatching.p Contains: xxx put contents here xxx Version: Technology: xxx put the technology version here xxx Release: Universal Interfaces 3.0d3 on Copland DR1 Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved. Bugs?: If you find a problem with this file, send the file and version information (from above) and the problem description to: Internet: apple.bugs@applelink.apple.com AppleLink: APPLE.BUGS } {$IFC UNDEFINED UsingIncludes} {$SETC UsingIncludes := 0} {$ENDC} {$IFC NOT UsingIncludes} UNIT DriverFamilyMatching; INTERFACE {$ENDC} {$IFC UNDEFINED __DRIVERFAMILYMATCHING__} {$SETC __DRIVERFAMILYMATCHING__ := 1} {$I+} {$SETC DriverFamilyMatchingIncludes := UsingIncludes} {$SETC UsingIncludes := 1} {$IFC UNDEFINED __TYPES__} {$I Types.p} {$ENDC} {$IFC UNDEFINED __NAMEREGISTRY__} {$I NameRegistry.p} {$ENDC} {$IFC UNDEFINED __TEXTOBJECTS__} {$I TextObjects.p} {$ENDC} {$IFC UNDEFINED __CODEFRAGMENTS__} {$I CodeFragments.p} {$ENDC} {$PUSH} {$ALIGN MAC68K} {$LibExport+} { Please refer to Devices.i for DriverDescriptor definition for Marconi } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } { ######################################################### Descriptor for Drivers and NDRVs ######################################################### } { Driver Typing Information Used to Match Drivers With Devices } TYPE DriverTypePtr = ^DriverType; DriverType = RECORD nameInfoStr: Str31; { Driver Name/Info String } version: NumVersion; { Driver Version Number } END; { OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment } RuntimeOptions = OptionBits; CONST kDriverIsLoadedUponDiscovery = $00000001; { auto-load driver when discovered } kDriverIsOpenedUponLoad = $00000002; { auto-open driver when loaded } kDriverIsUnderExpertControl = $00000004; { I/O expert handles loads/opens } kDriverIsConcurrent = $00000008; { supports concurrent requests } kDriverQueuesIOPB = $00000010; { device manager doesn't queue IOPB } kDriverIsLoadedAtBoot = $00000020; { Driver is loaded at the boot time } kDriverIsForVirtualDevice = $00000040; { Driver is for a virtual Device } TYPE DriverOSRuntimePtr = ^DriverOSRuntime; DriverOSRuntime = RECORD driverRuntime: RuntimeOptions; { Options for OS Runtime } driverName: Str31; { Driver's name to the OS } driverDescReserved: ARRAY [0..7] OF UInt32; { Reserved area } END; { OS Service Information Used To Declare What APIs a Driver Supports } ServiceCount = UInt32; DriverServiceInfoPtr = ^DriverServiceInfo; DriverServiceInfo = RECORD serviceCategory: OSType; { Service Category Name } serviceType: OSType; { Type within Category } serviceVersion: NumVersion; { Version of service } END; DriverOSServicePtr = ^DriverOSService; DriverOSService = RECORD nServices: ServiceCount; { Number of Services Supported } service: ARRAY [0..0] OF DriverServiceInfo; { The List of Services (at least one) } END; { Categories } CONST kServiceCategoryDisplay = 'disp'; { Display Manager } kServiceCategoryOpenTransport = 'otan'; { Open Transport } kServiceCategoryBlockStorage = 'blok'; { Block Storage } kServiceCategoryNdrvDriver = 'ndrv'; { Generic Native Driver } kServiceCategoryScsiSIM = 'scsi'; { SCSI } kServiceCategoryFileManager = 'file'; { File Manager } kServiceCategoryIDE = 'ide-'; { ide } kServiceCategoryADB = 'adb-'; { adb } kServiceCategoryPCI = 'pci-'; { pci bus } { Nu Bus } kServiceCategoryPCMCIA = 'pcmc'; { PCMCIA } kServiceCategoryDFM = 'dfm-'; { DFM } kServiceCategoryMotherBoard = 'mrbd'; { mother Board } kServiceCategoryKeyboard = 'kybd'; { Keyboard } kServiceCategoryPointing = 'poit'; { Pointing } kServiceCategoryRTC = 'rtc-'; { RTC } kServiceCategoryNVRAM = 'nram'; { NVRAM } kServiceCategorySound = 'sond'; { Sound (1/3/96 MCS) } kServiceCategoryPowerMgt = 'pgmt'; { Power Management } kServiceCategoryGeneric = 'genr'; { Generic Service Category to receive general Events } { Ndrv ServiceCategory Types } kNdrvTypeIsGeneric = 'genr'; { generic } kNdrvTypeIsVideo = 'vido'; { video } kNdrvTypeIsBlockStorage = 'blok'; { block storage } kNdrvTypeIsNetworking = 'netw'; { networking } kNdrvTypeIsSerial = 'serl'; { serial } kNdrvTypeIsSound = 'sond'; { sound } kNdrvTypeIsBusBridge = 'brdg'; TYPE DriverDescVersion = UInt32; { The Driver Description } CONST kInitialDriverDescriptor = 0; kVersionOneDriverDescriptor = 1; kTheDescriptionSignature = 'mtej'; kDriverDescriptionSignature = 'pdes'; TYPE DriverDescriptionPtr = ^DriverDescription; DriverDescription = RECORD driverDescSignature: OSType; { Signature field of this structure } driverDescVersion: DriverDescVersion; { Version of this data structure } driverType: DriverType; { Type of Driver } driverOSRuntimeInfo: DriverOSRuntime; { OS Runtime Requirements of Driver } driverServices: DriverOSService; { Apple Service API Membership } END; {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } { ################################################ Family Matching Data Structure ################################################ } { The Family Type } CONST kFamilyIsHighLevel = 0; { High Level Family } kFamilyIsLowLevel = 1; { Low Level Family } TYPE FamilyLevel = UInt32; { Family Typing Information Used to Match Families With plug-ins and Devices } FamilyTypePtr = ^FamilyType; FamilyType = RECORD familyLevel: FamilyLevel; { Kind of Family } familyName: OSType; { Family Name } version: NumVersion; { Family Version Number } reserved: OSType; { Used by Mother Board Expert } END; CONST kFamilyIsLoadedAtBoot = $00000001; { Family is loaded at the boot time } kFamilyIsLoadedUponDiscovery = $00000002; { auto-load Family when discovered } kFamilyIsStartedAtBoot = $00000004; { Family is initialized at the Boot } TYPE FamilyOSRunTimeOptions = UInt32; FamilyOSRunTimePtr = ^FamilyOSRunTime; FamilyOSRunTime = RECORD familyRuntime: FamilyOSRunTimeOptions; { Options for OS Runtime } familyName: Str31; { Family's name to the OS } familyDescReserved: ARRAY [0..7] OF UInt32; { Reserved area } END; { The Family Description } CONST kFamilyDescriptionSignature = 'fdes'; TYPE FamilyDescVersion = UInt32; CONST kInitialFamilyDescriptor = 0; kMotherBoardDescriptor = 1; TYPE DependencyCount = UInt32; MatchingAndDependencyInfoPtr = ^MatchingAndDependencyInfo; MatchingAndDependencyInfo = RECORD CASE INTEGER OF 0: ( deviceName: Str31; { the device name to match } ); 1: ( dependency: OSType; { Dependency List } ); END; FamilyMatchingAndDependencyPtr = ^FamilyMatchingAndDependency; FamilyMatchingAndDependency = RECORD nrElements: DependencyCount; { Number of elements in the Array } matchingInfo: ARRAY [0..0] OF MatchingAndDependencyInfo; END; FamilyDescriptionPtr = ^FamilyDescription; FamilyDescription = RECORD familyDescSignature: OSType; { Signature field of this structure } familyDescVersion: FamilyDescVersion; { Version of this data structure } familyType: FamilyType; { Type of Driver } familyOSRuntime: FamilyOSRunTime; { OS Runtime Requirements of Family } familymatchingAndDependency: FamilyMatchingAndDependency; { Family Dependency Info } END; { ############################################## Definition of "driver-ptr" property ############################################## } DriverPtrPropertyPtr = ^DriverPtrProperty; DriverPtrProperty = RECORD pluginLocator: LogicalAddress; length: UInt32; END; { ############################################## Status Definition for DFMReportInitStatus ############################################## } CONST kInitStatusOK = 0; kInitStatusNotOK = 1; { ############################################## Declare the pluginLoadID ############################################## } TYPE PluginLoadID = ^LONGINT; { ############################################## Function Prototypes ############################################## } FUNCTION DFMReportInitStatus(serviceCategory: OSType; status: UInt32): UInt32; C; FUNCTION DFMRemovePlugIns(VAR device: RegEntryRef; serviceCategory: OSType; nrPlugIns: UInt32; VAR pluginLocatorsInUse: LogicalAddress): OSStatus; C; FUNCTION DFMLoadPlugin(pluginLocator: LogicalAddress; pluginName: Str63; VAR pluginLoadID: PluginLoadID; VAR main: LogicalAddress; VAR pluginDT: LogicalAddress; optErrMsg: TextObject): OSStatus; C; FUNCTION DFMUnloadPlugin(VAR pluginLoadID: PluginLoadID): OSStatus; C; FUNCTION DFMGetCFragConnectID(VAR pluginLoadID: PluginLoadID; VAR connectionID: CFragConnectionID): OSStatus; C; { ############################################## Well known properties in the Name Registry ############################################## } { CPassThru } {$ENDC} {$ALIGN RESET} {$POP} {$SETC UsingIncludes := DriverFamilyMatchingIncludes} {$ENDC} {__DRIVERFAMILYMATCHING__} {$IFC NOT UsingIncludes} END. {$ENDC}